#include<stdio.h>
int main ()
{
	int n,i;
	while(scanf("%d",&n)!=EOF&&n!=0)
	{
		int a[n];
		int sum;
		for(i=0;i<n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(i=0;i<n;i++)
		{
			sum=sum+a[i];
		}
		printf("%d\n",sum);
	}
	return 0;
}
